package com.jm.utils.htmlNode;

import java.util.Hashtable;

import com.jm.web.BasePage;

/**
 * @author yanjie
 * Oct 28, 2011 10:28:56 AM
 */
public class BaseNode extends XmlNode{
	protected BasePage page = null;
	@Override
	public void init(Object node,BasePage page) {
		this.page = page;
		onInit(node);
		loadConfig();
	}
	
	public void onInit(Object node){}
	public void loadConfig(){}
	
	protected String nodeName = "";
	protected String nodeValue = "";
	protected Hashtable attributes = null;
	protected NodeList childNodes = null;
	
	public void putAttribute(String key,String value){
		if(this.attributes == null)
			this.attributes = new Hashtable();
		this.attributes.put(key,value);
	}
	
	public Hashtable getAttributes() {
		return attributes;
	}
	public void setAttributes(Hashtable attributes) {
		this.attributes = attributes;
	}
	public NodeList getChildNodes() {
		return childNodes;
	}
	public void setChildNodes(NodeList childNodes) {
		this.childNodes = childNodes;
	}
	public String getNodeName() {
		return nodeName;
	}
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}
	public String getNodeValue() {
		return nodeValue;
	}
	public void setNodeValue(String nodeValue) {
		this.nodeValue = nodeValue;
	}

	public BasePage getPage() {
		return page;
	}

	public void setPage(BasePage page) {
		this.page = page;
	}
}
